Trait isotope::value::Value[][src]

pub trait Value: Sized + Clone + Debug {
Show methods fn ty(&self) -> &ValId;
fn into_enum(self) -> ValueEnum;
fn code(&self) -> u64; fn is_ty(&self) -> bool { ... }
fn is_groupoid(&self) -> bool { ... }
fn is_kind(&self) -> bool { ... }
fn is_instant(&self) -> bool { ... }
fn elem_linearity(&self) -> Result<Linearity, Error> { ... }
fn elem_constraints(&self) -> Result<&Constraints, Error> { ... }
fn is_lifetime(&self) -> bool { ... }
fn ty_linearity(&self) -> Linearity { ... }
fn linearity(&self) -> Linearity { ... }
fn is_nonlinear(&self) -> bool { ... }
fn is_const(&self) -> bool { ... }
fn into_valid(self) -> ValId { ... }
fn fv(&self) -> &SymbolSet { ... }
fn def_fv(&self) -> &SymbolSet { ... }
fn local_constraints(&self) -> &Constraints { ... }
fn instant_constraint(&self) -> Result<&Constraint, Error> { ... }
fn is_normal(&self) -> bool { ... }
fn normalized(&self) -> Option<&ValId> { ... }
fn contains(&self, value: &ValId) -> Result<Match, Error> { ... }
fn subtype(&self, other: &ValId, variance: Variance) -> Result<Match, Error> { ... }
fn apply_in_ctx(
        &self,
        arg: &ValId,
        ctx: &mut EvalCtx
    ) -> Result<ValId, Error> { ... }
fn try_apply_in_ctx(
        &self,
        _arg: &ValId,
        _ctx: &mut EvalCtx
    ) -> Result<Application, Error> { ... }
fn eval_in_ctx(&self, ctx: &mut EvalCtx) -> Option<ValId> { ... }
fn apply(&self, arg: &ValId) -> Result<ValId, Error> { ... }
fn apply_norm(&self, arg: &ValId) -> Result<ValId, Error> { ... }
fn try_apply(&self, arg: &ValId) -> Result<Application, Error> { ... }
fn try_apply_norm(&self, arg: &ValId) -> Result<Application, Error> { ... }
fn apply_ty_in_ctx(
        &self,
        _arg: &ValId,
        _ctx: &mut EvalCtx
    ) -> Result<Abstract, Error> { ... }
fn apply_ty(&self, arg: &ValId) -> Result<Abstract, Error> { ... }
fn normal_code(&self) -> u64 { ... }
}
Expand description

The trait implemented by all isotope values

Required methods

Get the type of this value

Convert this value into a ValueEnum

Get the hash-code of a value.

This allows for rapid equality testing, with a small false positive probability. There are no false negatives.

Provided methods

Get whether this value is a type

Whether this type, as a category, is a groupoid. Returns false if this value is not a type

Get whether this value is a kind

Get whether this value is an instant

If this value is a type, the linearity of its elements; otherwise, return an error

If this value is a type, the minimal constraint of all it’s elements; otherwise, return an error

Get whether this value is a lifetime

Get the maximal linearity of this value’s type

The linearity of this value. Always strictly weaker than it’s type’s linearity.

Get whether this value is nonlinear

Get whether this value is a constant, and hence should not be included in dependency lists

Convert this value into a ValId

Get the free variable set of this value

Get this value’s definitional free variable set

Get the local constraint set of this value

If this value is an instant, get it’s constraint set, otherwise, return an error

Get whether this value is in normal form

Get the normal form of this value, or None if it is already normalized

Whether this value, as a type, contains the other value under a given set of constraints, and if so, which constraints.

Check if the left type matches the right type given the given variance

Return an error if not, or if either the left or right are not types

Attempt to apply this value to a given argument vector, yielding a result

Returns an error if:

  • This value is not a function
  • The types don’t match under the desired variance

Attempt to apply this value to a given argument vector in a given context, yielding a result. Returns None if the result is just the value itself.

Returns an error if:

  • This value is not a function
  • The types don’t match under the desired variance

Evaluate this value in a given context

Return None if no changes were made

Attempt to apply this value to a given value, yielding a result

Returns an error if:

  • This value is not a function
  • The types don’t match under the desired variance

Attempt to apply this value to a given value, yielding a normalized result

Returns an error if:

  • This value is not a function
  • The types don’t match under the desired variance

Attempt to apply this value to a given value, yielding a result or a result type (for an abstract application)

Returns an error if:

  • This value is not a function
  • The types don’t match under the desired variance

Attempt to apply this value to a given value, yielding a normalized result or a result type (for an abstract application)

Returns an error if:

  • This value is not a function
  • The types don’t match under the desired variance

Attempt to apply this function type to a given value, yielding a result type and a constraint-set

Returns an error if:

  • This value is not a function type
  • The types don’t match under the desired variance

Attempt to apply this function type to a given value, yielding a result type and a constraint-set

Returns an error if:

  • This value is not a function type
  • The types don’t match under the desired variance

Get the normal hash-code of a value.

This allows for rapid normal equality testing, with a small false positive probability. There are no false negatives.

Implementations on Foreign Types

Implementors